use hypers::oapi::openapi;
use crate::dto::{Res,ResObj,match_ok_common_result_no_error};
use crate::dto::monitor::ServerInfo;
use crate::service::monitor_service;

pub struct Monitor;

#[openapi]
impl Monitor {
    #[get(
        "/monitor/server",
        tag("系统"),
        response(
            (status = 200,body=ResObj<ServerInfo>,description ="部门列表")
        ),
    )]
    async fn get_server_info() ->Res<ServerInfo> {
        match_ok_common_result_no_error(monitor_service::get_sys_info().await)
    }
}